#ifndef _CUSTOM_BUTTON_H_
#define _CUSTOM_BUTTON_H_

#include "cocos2d.h"
#include "Box2D/Box2D.h"

using namespace cocos2d;

#define PTM_RATIO 32


class CustomButton : public CCNode
{
	CCSprite* m_NormalImage;
	CCSprite* m_SelectedImage;

	bool m_bIsSelected;
	bool m_TouchByArea;

	CCRect m_BoundingTouch;

public:
	CustomButton();
	virtual ~CustomButton()
	{
		//if( m_NormalImage )
		//	m_NormalImage->release();

		//if( m_SelectedImage )
		//	m_SelectedImage->release();
	}

	bool initWithNormalImage(const char* _NormalImage, const char* _SlectedImage);
	static CustomButton* ButtonWithNormalImage(const char* _NormalImage, const char* _SlectedImage);

	bool isSelected() {return m_bIsSelected;}
	void SetisSelected(bool _b);

	void SetTouchbyArea(bool _b) {m_TouchByArea = _b;};
	bool isTouchByArea() {return m_TouchByArea;};

	void ComputeBoundingTouch();
	void drawBoundingBox();

	void SetBoundingTouch( CCRect _bTouch ) { m_BoundingTouch = _bTouch; }
	CCRect GetBoundingTouch() { return m_BoundingTouch; }
};

#endif